<template>
  <div>
    <van-cell-group>
      <select-tag :multiple="true" :selects="students" @getAllSelected="getAllSelected">
        <van-field label="发送对象" type="textarea" rows="1" autosize v-model="users" disabled placeholder="选择发送对象"/>
      </select-tag>
      <van-field v-model="message" label="通知内容" type="textarea" placeholder="请输入内容" rows="4" autosize/>
    </van-cell-group>
    <div class="sub">
      <van-button type="info" size="large">发送</van-button>
    </div>
  </div>
</template>

<script>
import selectTag from '@/components/selectTag'
export default {
  name: 'send-message',
  data () {
    return {
      users: '',
      students: [
        {name: '唐僧', id: 1},
        {name: '孙悟空', id: 2},
        {name: '猪八戒', id: 3},
        {name: '沙悟净', id: 4},
        {name: '白骨精', id: 5},
        {name: '白龙马', id: 6},
        {name: '天蓬元帅', id: 7}
      ],
      message: ''
    }
  },
  methods: {
    getAllSelected ({idx, names}) {
      this.users = names
    }
  },
  components: {
    selectTag
  },
  created () {
  }
}
</script>

<style scoped>
  .sub{
    margin-top: 100px;
    padding: 10px;
  }
</style>
